package com.pay.ioopos.activity;

import android.content.Intent;
import android.os.Bundle;

import com.pay.ioopos.KeyInfo;
import com.pay.ioopos.R;
import com.pay.ioopos.fragment.ConnectFragment;

import static com.pay.ioopos.KeyInfo.KEY_CANCEL;
import static com.pay.ioopos.KeyInfo.KEY_ENTER;
import static com.pay.ioopos.KeyInfo.KEY_NUM_1;
import static com.pay.ioopos.KeyInfo.KEY_NUM_2;
import static com.pay.ioopos.KeyInfo.KEY_NUM_3;

public class ConnectActivity extends AbstractActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_connect);
        setMainFragment(new ConnectFragment());
    }

    @Override
    public boolean onKeyDown(KeyInfo keyInfo) {
        if (keyInfo == KEY_ENTER || keyInfo == KEY_CANCEL) {
            Intent intent = new Intent(this, SettingActivity.class);
            startActivity(intent);
        } else if (keyInfo == KEY_NUM_1) {
            Intent intent = new Intent(this, NetworkActivity.class);
            startActivity(intent);
        } else if (keyInfo == KEY_NUM_2) {
            Intent intent = new Intent(this, DomainActivity.class);
            startActivity(intent);
        } else if (keyInfo == KEY_NUM_3) {
            Intent intent = new Intent(this, WifiActivity.class);
            startActivity(intent);
        }
        return false;
    }

}
